package com.mywork.mvpkodeingithub.data.api

import com.mywork.mvpkodeingithub.common.HEADER_API_VERSION
import com.mywork.mvpkodeingithub.data.response.Repo
import com.mywork.mvpkodeingithub.data.response.User
import io.reactivex.Observable
import retrofit2.Response
import retrofit2.http.GET
import retrofit2.http.Headers
import retrofit2.http.Path
import retrofit2.http.Query

interface GithubApi {

    @Headers(HEADER_API_VERSION)
    @GET("/users")
    fun getUsers(@Query("since") lastIdQueried: Int, @Query("per_page") perPage: Int): Observable<List<User>>

    @Headers(HEADER_API_VERSION)
    @GET("/users/{username}/repos")
    fun getRepos(@Path("username") userName: String): Observable<List<Repo>>

    @Headers(HEADER_API_VERSION)
    @GET("/users/{username}")
    fun getUser(@Path("username") username: String): Observable<Response<User>>
}